typedef LRESULT (CALLBACK* MSGPROCFUNC)(HWND, WPARAM, LPARAM);

/********************************
* MsgMappingItem
* Containing three fields: 
*		Msg(UINT), 
*		Msg Process Function Pointer, 
*		pointer to next item
***/
class MsgMappingItem
{
	friend class MsgMappingTable;	// set friend, let MsgMappingTable get the next node.
public:
	MsgMappingItem(int Msg, MSGPROCFUNC ProcFunc)
		: msg(Msg), ProcFunc(ProcFunc), pNext(0){}
	int msg;
	MSGPROCFUNC ProcFunc;
private:
	MsgMappingItem* pNext;
};

/********************************
* MsgMappingTable
* A table stores Mapping from Msg to Msg Process Function
***/
class MsgMappingTable
{
public:
	MsgMappingTable() : pStart(0){}
	void Append(const MsgMappingItem& Item);
	void Clear();
	MSGPROCFUNC Find(int msg);
	~MsgMappingTable(){Clear();}
private:
	MsgMappingItem* pStart;
};

